using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Musicman.Business;

namespace MusicmanWeb
{
    public partial class Register : MusicmanPage
    {
        private MusicmanWeb.Custom.MyRegisterControl myRegisterControl;

        protected override void Page_Load(object sender, EventArgs e)
        {
            if (Request["ACTIVATIONCODE"] == null)
            {
                myRegisterControl = (MusicmanWeb.Custom.MyRegisterControl)LoadControl("~/Custom/MyRegisterControl.ascx");
                myRegisterControl.AppServer = GetAppServer();
                PlaceHolder1.Controls.Add(myRegisterControl);
            } else 
            {
                string activationCode = Request["ACTIVATIONCODE"];
                Label l = new Label();
                if (DataManager.Instance.ActivateNewUser(activationCode))
                {
                    l.Text = "Congratulations";
                }
                else
                {
                    l.Text = "Fail";
                }
                PlaceHolder1.Controls.Add(l);
            }
        }
    }
}
